Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@babel/plugin-syntax-function-bind
Advanced tools
@babel/plugin-syntax-function-bind is a Babel plugin that allows you to use the function bind syntax in your JavaScript code. This syntax is a proposed feature for ECMAScript that allows you to bind a function to a specific context (this value) more succinctly.
Function Bind Syntax
This feature allows you to use the `::` operator to bind a function to a specific context. In this example, `obj::getX` binds the `getX` function to the `obj` object, so when `boundGetX` is called, it returns `42`.
const obj = { x: 42 };
const getX = function() { return this.x; };
const boundGetX = obj::getX;
console.log(boundGetX()); // 42
Lodash is a utility library that provides a wide range of functions for common programming tasks, including function binding. The `_.bind` method in Lodash can be used to bind a function to a specific context, similar to the function bind syntax provided by @babel/plugin-syntax-function-bind.
Core-js is a modular standard library for JavaScript that includes polyfills for many ECMAScript features, including function binding. While it doesn't provide the same syntax as @babel/plugin-syntax-function-bind, it offers similar functionality through its polyfills.
Allow parsing of function bind
See our website @babel/plugin-syntax-function-bind for more information.
Using npm:
npm install --save-dev @babel/plugin-syntax-function-bind
or using yarn:
yarn add @babel/plugin-syntax-function-bind --dev
v7.25.7 (2024-10-02)
babel-helper-validator-identifier
babel-traverse
babel-plugin-transform-classes
super()
check (@nicolo-ribaudo)babel-generator
infer
in compact mode (@nicolo-ribaudo)[no LineTerminator here]
after nodes (@nicolo-ribaudo)babel-types
babel-core
--experimental-require-module
(@nicolo-ribaudo)babel-helper-compilation-targets
, babel-helper-plugin-utils
, babel-preset-env
babel-plugin-proposal-destructuring-private
, babel-plugin-syntax-decimal
, babel-plugin-syntax-import-reflection
, babel-standalone
babel-generator
[no LineTerminator here]
before nodes (@nicolo-ribaudo)babel-plugin-transform-typescript
babel-types
BABEL_TYPES_8_BREAKING
at startup (@nicolo-ribaudo)FAQs
Allow parsing of function bind
We found that @babel/plugin-syntax-function-bind demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.